using System.Web;
using System.Xml;
using System;

/*	-----------------------------------------------------------------------	
	Copyright:	umlungu consulting (pty) ltd
	Author:		Alan Benington	
	Started:	2007-10-27	
	Status:		release	
	Version:	2.0.0
	Build:		20071027
	License:	GNU General Public License
	-----------------------------------------------------------------------	*/

/*	---------------------------------------------------------------------------	
	Development Notes:
	==================
	20071027:	New object from blogx.x_config
				The configuration element is as follows:
				<engineX>
					<EmailX from="" to="" bcc="" host="" subject="">
						<Smtp username="" password=""></Smtp>
					</EmailX>
	20070314:	Fixed bug where Subject property was not getting value from
				@subject attribute
	20080420:	Added IMAP config sub-section, as follows:
						<Imap host="" port="" ssl="" username="" password=""/>
	---------------------------------------------------------------------------	*/

namespace umlungu.engineX.emailX {
	/// <summary>
	/// Description of the x_config class.
	/// <para>Additional information about the class</para>
	/// </summary>
	public class x_config : umlungu.engineX.x_config {
		#region Invisible properties
		#endregion

		#region Constants
		private const string CONFIG_ROOT = "EmailX";
		private const string CONFIG_SMTP = "Smtp";
		private const string CONFIG_IMAP = "Imap";
		#endregion

		#region Visible properties
		/// <summary>The from address for email</summary>
		/// <value>email address</value>
		public string From {
			get { return Value(String.Concat(CONFIG_ROOT, "/@from")); }
		}
		/// <summary>The to address for email</summary>
		/// <value>email address</value>
		public string To {
			get { return Value(String.Concat(CONFIG_ROOT, "/@to")); }
		}
		/// <summary>The bcc address for email</summary>
		/// <value>email address</value>
		public string Bcc {
			get { return Value(String.Concat(CONFIG_ROOT, "/@bcc")); }
		}
		/// <summary>The subject  for email</summary>
		/// <value>subject</value>
		public string Subject {
			get { return Value(String.Concat(CONFIG_ROOT, "/@subject")); }
		}
		/// <summary>The email server</summary>
		/// <value>email server host name</value>
		public string Host {
			get { return Value(String.Concat(CONFIG_ROOT, "/@host")); }
		}
		/// <summary>The email type</summary>
		/// <value>email type, ie 'html', 'xml' or 'text'</value>
		public string Type {
			get { return Value(String.Concat(CONFIG_ROOT, "/@type")); }
		}
		/// <summary>The docpath for email attatchments</summary>
		/// <value>path to directory relative to root</value>
		public string DocPath {
			get { return Value(String.Concat(CONFIG_ROOT, "/@docpath")); }
		}
		/// <summary>The Smtp server username (for raw sends)</summary>
		/// <value>Smtp username</value>
		public string SmtpUsername {
			get { return Value(String.Concat(CONFIG_ROOT, "/", CONFIG_SMTP, "/@username")); }
		}
		/// <summary>The Smtp server password (for raw sends)</summary>
		/// <value>Smtp password</value>
		public string SmtpPassword {
			get { return Value(String.Concat(CONFIG_ROOT, "/", CONFIG_SMTP, "/@password")); }
		}
		/// <summary>The IMAP server url / IP</summary>
		/// <value>IMAP server</value>
		public string ImapServer {
			get { return Value(String.Concat(CONFIG_ROOT, "/", CONFIG_IMAP, "/@host")); }
		}
		/// <summary>The IMAP server port</summary>
		/// <value>IMAP port</value>
		public string ImapPort {
			get { return Value(String.Concat(CONFIG_ROOT, "/", CONFIG_IMAP, "/@port")); }
		}
		/// <summary>Is the IMAP server ssl</summary>
		/// <value>IMAP ssl flag</value>
		public string ImapSSL {
			get { return Value(String.Concat(CONFIG_ROOT, "/", CONFIG_IMAP, "/@ssl")); }
		}
		#endregion

		#region Constructors/Destructors
		/// <overloads>Constructor</overloads>
		/// <summary>Default constructor</summary>
		public x_config() : base() {
		}
		#endregion

		#region Public methods
		#endregion
		
		#region Protected methods
		#endregion
		
		#region Private methods
		#endregion
	}
}
